package com.platform.enums;

import com.platform.comm.constants.EnumOption;
import com.platform.comm.enums.IEnumOption;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 公告类型
 * @author zq
 */
@EnumOption(name = "sysNotifyUserType")
public enum SysNotifyUserType implements IEnumOption<String> {

    /**
     * 未读
     */
    UNREAD("未读"),

    /**
     * 已读
     */
    READED("已读");

    private String text;

    public String getText() {
        return text;
    }

    SysNotifyUserType() {
    }

    SysNotifyUserType(String text) {
        this.text = text;
    }

    /**
     * 枚举项 “键”
     *
     * @return key
     */
    @Override
    public String key() {
        return this.name();
    }

    /**
     * 枚举项 “值”
     *
     * @return value
     */
    @Override
    public String value() {
        return this.text;
    }

    /**
     * 枚举options
     *
     * @return
     */
    @Override
    public Map<String, String> enums() {
        return Arrays.stream(values()).collect(Collectors.toMap(IEnumOption::key, IEnumOption::value));
    }
}
